package com.springboot.cloud.demos.feign.service;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.entity.form.UnitForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "ribbon-consumer", fallback = UnitServiceFallback.class)
public interface UnitService {

    @RequestMapping(value = "/unit", method = RequestMethod.GET)
    Result<List<Map<String, Object>>> unit(@RequestParam("levelId") String levelId);

    @RequestMapping(value = "/queryByLevelAndUser", method = RequestMethod.GET)
    Result<List<Map<String, Object>>> queryByLevelAndUser(@RequestParam("levelId") String levelId, @RequestParam("userId") String userId);

    @RequestMapping(value = "/unit/{id}", method = RequestMethod.GET)

    Result get(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/unit", method = RequestMethod.PUT)
    void update(@RequestBody UnitForm unitForm);
}
